package com.chengfei.thread.demo1;

import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

/**
 * @author chengfei5
 * @date 2019/1/7
 */
@Service
public class NewThread7 {
    @Async
    public void a(){
        while (true){
            System.out.println("a");
            try {
                Thread.sleep(2000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
    @Async
    public void b(){
        System.out.println("b");
        try {
            Thread.sleep(2000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
